<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改渠道信息')" />
    <th:block th:include="include :: select2-css" />

</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-channel-edit" th:object="${channelInfo}">
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">渠道编号：</label>
                <div class="col-sm-8">
                    <input name="channelCode" th:field="*{channelCode}" readonly="true" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">渠道名称：</label>
                <div class="col-sm-8">
                    <input th:field="*{channelName}" readonly="true"  class="form-control" type="text" required>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">渠道商务：</label>
                <div class="col-sm-8">
                    <select name="channelType"  class="form-control" th:field="*{ownerId}">
                        <option th:each="item:${managerInfoList}" th:value="${item.userId}"
                                th:text="${item.username}" ></option>
                    </select>
                </div>
            </div>

            <div class="form-group" th:if="*{chargeType == 2}">
                <label class="col-sm-3 control-label is-required">渠道比率：</label>
                <div class="col-sm-8">
                    <input name="channelRate" th:field="*{channelRate}" class="form-control" type="text" required>
                    <span style="color: red">渠道统计时，按照该值进行扣量（例如：0.9。扣量10%）</span>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label is-required">渠道价格：</label>
                <div class="col-sm-8">
                    <input name="chargeAmount" th:field="*{chargeAmount}" class="form-control" type="text" required>
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var prefix = ctx + "extend/channel";
        $("#form-channel-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/editMainSave", $('#form-channel-edit').serialize());
            }
        }

    </script>
</body>
</html>